<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- div*10{hello} -->
    <!-- div*10{$} -->
    <!-- div*100{case $:} -->
</body>
<script>

    // 注意: switch也可以在case中书写条件表达式 => 此时switch中中()内改为true (了解)

    var grade = Math.round(Math.random() * 100);
    console.log(grade);

    switch (true) { //75
        case grade >= 90: // true | false
            document.write(grade + "分,优秀");
            break;
        case grade >= 80 && grade < 90:
            document.write(grade + "分,良好");
            break;
        case grade >= 70 && grade < 80:
            document.write(grade + "分,一般");
            break;
        case grade >= 60 && grade < 70:
            document.write(grade + "分,及格");
            break;
        default:
            document.write(grade + "分,不及格");
            break;
    }


</script>

</html>